<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>${username!'游客'}</title>
</head>
<body>

<div>
    <p>${username!'游客'}</p>
</div>

<div>
    <a href="/logout">退出登陆</a>
</div>

<div>
    <a href="/auth/logout">自定义退出</a>
</div>

<script src="/assets/js/jquery.min.js"></script>
<script>
    var token = '${token!""}';

    test('/api/user/create', token)
    test('/api/user/read', token)
    test('/api/user/update', token)
    test('/api/user/delete', token)

    test('/api/admin/create', token)
    test('/api/admin/read', token)
    test('/api/admin/update', token)
    test('/api/admin/delete', token)

    function test(url) {
        $.ajax({
            url: url,
            headers: {
                Authorization: token
            },
            success: function (res) {
                console.log(res)
            }
        });
    }
</script>

</body>
</html>
